Repository navigation
docs: explain why console coverage reporters print mid-run - #1009
Merged
Merged
Conversation
The report is generated from the support file's after() hook while the spec is still running, so text reporters and a coverage:report script that prints to stdout interleave with Cypress's own output. Document the cause and the workaround: keep file reporters in the NYC config and run `nyc report --reporter=text-summary` after `cypress run`. Reporting from the after:run node event would fix the ordering for real, but that's a larger change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUv8r5MtAAp1pTkx3fSG1a
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUv8r5MtAAp1pTkx3fSG1a
|
🎉 This PR is included in version 4.1.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Additional details
Ever seen the coverage table pop up right before your last test's result? That's what #465 is about, and it still happens on
master.The plugin builds the report in the support file's
after()hook (lib/support.ts), which runs at the end of each spec while Cypress is still printing that spec's results. Two things then write straight to the terminal and interleave with the test output:text,text-summary)coverage:reportscript, which runs withstdio: 'inherit'(lib/task.ts)It's cosmetic, and the coverage numbers are correct.
This PR adds a short "Console reporters print mid-run" subsection under Custom reporters in the README. It explains the cause and shows the workaround from the issue thread: keep only file reporters in the nyc config, then run
nyc report --reporter=text-summaryaftercypress run.It's a docs-only change. Generating the report from the
after:runevent would fix the ordering for real, but that's a bigger change, and it would fit better alongside #506.A couple of notes for reviewers:
cypress run && nyc report ..., so the summary won't print when a test fails. I kept&&on purpose, because;would hide Cypress's failing exit code in CI.nycCLI only reads the first one. So if someone spreads their settings across several files, the summary could differ slightly from the plugin's report. That felt like too much of an edge case for the README.Steps to test
README.md.npm run check:markdownand confirm the#custom-nyc-commandlink resolves."reporter": ["lcov", "json"]in the nyc config, runcypress run && npx nyc report --reporter=text-summary, and check that the summary prints once, after all the Cypress output.I ran
npm run build,npm test(30/30) andnpm run format:check, and all three passed.How has the user experience changed?
No change to the plugin's behavior. The README now explains the mid-run output and how to avoid it.
Generated by Claude Code
Note
Low Risk
Documentation-only change; no runtime or configuration behavior is modified.
Overview
Adds a Console reporters print mid-run subsection under Custom reporters in the README (closes #465).
It documents that coverage reports run from the support file's per-spec
after()hook while Cypress is still printing results, so nyc console reporters (text,text-summary) and printingcoverage:reportscripts can interleave with test output once per spec even though the numbers are correct.The doc recommends using file-only reporters during the run and deferring a single summary with
cypress run && nyc report --reporter=text-summary, noting thatnyc reportreads.nyc_outputwithout re-running tests.Reviewed by Cursor Bugbot for commit 30296b5. Bugbot is set up for automated code reviews on this repo. Configure here.